const Service = require('egg').Service;

class UserService extends Service{
    async getUser(uid,rid){
        try{
            var user = await this.app.mysql.get('manager',{id:uid});
            const restaurant = await this.app.mysql.get('restaurant',{id:rid});
            return {
                uid:user.id,
                name:user.name,
                phone:user.phone,
                avatar:user.avatar,
                restaurant:restaurant
            };
        }catch(err){
            this.ctx.status = 500;
        }

    }
}
module.exports = UserService;
